#lang rosetta-racket


(provide open-spline
         automatically-closed-spline
         closed-spline
         closed-spline-with-warning
         
         open-spline-tan
         automatically-closed-spline-tan
         closed-spline-tan
         closed-spline-tan-with-warning)


(define (open-spline)
  (lift
   (thunk (displayln "Open spline"))
   (spline u0 ux uxyz)))

(define (automatically-closed-spline)
  (lift
   (thunk (displayln "Automatically closed spline"))
   (move-x 1 (spline u0 ux uxyz u0))))

(define (closed-spline)
  (lift
   (thunk (displayln "Closed spline"))
   (move-x 2 (spline-closed u0 ux uxyz))))

(define (closed-spline-with-warning)
  (lift
   (thunk (displayln "Closed spline with a warning"))
   (move-x 3 (spline-closed u0 ux uxyz u0))))

(define (open-spline-tan)
  (lift
   (thunk (displayln "Open spline with manual tangents"))
   (move-x 4 (spline-tan (list u0 ux uxyz) (xyz 1 0 1) (xyz -1 -1 0)))))

(define (automatically-closed-spline-tan)
  (lift
   (thunk (displayln "Automatically closed spline with manual tangents"))
   (move-x 5 (spline-tan (list u0 (xyz 1/2 -1/3 0) (xyz 1 0 0) (xyz 1/2 1/3 0) u0) (xyz -1 -1 0) (xyz 1 -1 0)))))

(define (closed-spline-tan)
  (lift
   (thunk (displayln "Closed spline with manual tangents"))
   (move-x 6 (spline-closed-tan (list u0 (xyz 1/2 -1/3 0) (xyz 1 0 0) (xyz 1/2 1/3 0)) (xyz -1 -1 0) (xyz 1 -1 0)))))

(define (closed-spline-tan-with-warning)
  (lift
   (thunk (displayln "Closed spline with manual tangents and warning"))
   (move-x 7 (spline-closed-tan (list u0 (xyz 1/2 -1/3 0) (xyz 1 0 0) (xyz 1/2 1/3 0) u0) (xyz -1 -1 0) (xyz 1 -1 0)))))